﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Jui.Master" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    list
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<%
    string Roleid = ViewData["id"].ToString();
    string pid = ViewData["pid"].ToString();
    string rtid = "0";
    string pidName = "根目录";
    if (pid != "0")
    {
        rtid = selectControlBLL.getNameById("id", pid, "Sys_IBKMmenuTree", "parid");
        pidName = selectControlBLL.getNameById("id", pid, "Sys_IBKMmenuTree", "title");
    }

    string rturl = "/SysMenu/Permission?v=" + Roleid + "&pid=" + rtid;
    string addurl = "/SysMenu/add_KM?v=" + Roleid + "&pid=" + pid;
    string delurl = "/SysMenu/del_KM?v=" + Roleid + "&pid=" + pid;
     %>
    <div id="layout" class="noNavTab ">
        <div id="navTab">
            <h2 class="contentTitle">
            菜单权限</h2>
            <div class="pageHeader">
                <div class="searchBar">
                    <table class="searchContent">
                        <tbody>
                            <tr>
                                <th>
                                    所属上级:
                                </th>
                                <td>
                                    <%:pidName %>
                                </td>
                                <th>
                                    角色名称:
                                </th>
                                <td>
                                    <%=selectControlBLL.getNameById("id", Roleid, "Sys_IBRoles", "Name")%>
                                </td>
                            </tr>
                        </tbody>
                    </table>
                </div>
            </div>
            <div class="pageContent">
                <div class="panelBar">
                    <ul class="toolBar">
                        <li><a title="确实要修改这些记录吗?" target="selectedTodo" rel="ids" callback="deleteDone"
                            posttype="string" href='<%:addurl %>' class="add"><span>启用权限</span></a>
                        </li>
                        <li><a title="确实要修改这些记录吗?" target="selectedTodo" rel="ids" callback="deleteDone"
                            posttype="string" href='<%:delurl %>' class="add"><span>禁用权限</span></a>
                        </li>
                        <li>
                            <a class="add" href='<%:rturl %>'><span>返回</span></a>
                        </li>
                        <li class="line">line</li>
                    </ul>
                </div>
                <div id="listDt" class="pageContent">
                    `
                </div>
            </div>
        </div>
    </div>

</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="HeadContent" runat="server">
<link href="/content/jui-normal.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="/Scripts/pager.js"></script>
<script language="javascript" type="text/javascript">
    $(function () {
        loadList(0);
    });
    function loadList(i) {
        var htmlname = "listDt";
        var pars = '<%=ViewData["pid"] %>';
        pars = encodeURI(pars);
        var name = "0_parid__0";
        var tName = '<%=DencryptHelper.Encrypt("Sys_IBKMmenuTree")%>';
        var control = "SysMenu/Roles/menu/ListControl";
        var datebase = "1";
        var states = 1;
        var vd = '<%=ViewData["id"] %>';
        
        menulist(htmlname, pars, name, tName, control, datebase, states,vd);
    }

    function menulist(htmlname, pars, name, tName, control, dtnum, states,vd) {
        //
        //alert(pars);
        $("#" + htmlname).load(
            "/SysMenu/SearchList",
            {
                pars: pars,
                name: name,
                tName: tName,
                control: control,
                pageindex: pIndex,
                pagesize: pSize,
                dtnum: dtnum,
                states: states,
                vd:vd
            }, function () {
                if (isDWZInit) {
                    var sId = "#" + htmlname;
                    initUI(sId);
                }
            }
        );

    }
    </script>
</asp:Content>
